package Exception;
/**
 * 
 */
public class Person {
	private int age;
	Person(){}
	Person(int age){
		this.age=age;
	}
	public int getAge(){
		return age;
	}
	public void setAge(int age)throws Exception{
		if(age<=0||age>100){
			throw new Exception("不是人类的年龄！");
		}
		this.age=age;
	}
	public static void main(String[] args){
		Person p=new Person(12);
		try{
		p.setAge(106);
		}catch(Exception e){
			System.out.println("出现异常！");
		}
	}
}
